<div id="users_management">
	<h1>Users</h1>
	<% if current_user.is_administrator? %>
	<b>There are <%= pluralize(users.size, 'user') %> in the system. You and other <%= pluralize(users.size - 1, 'user') %>.</b>
	<br />
	<% end %>
	
	<% unless users.blank? %>
		<div class="span-18 list_header bold last">
			<div class="span-8 description">User</div>
			<% if current_user.has_role? Role::Admin %><div class="span-4 description">Administrator's Privilege</div><% end %>
			<div class="span-4 description">Editor's Privilege</div>
		</div>
		<% users.each do |user| %>
			<% next if current_user == user %>
		
			<div class="span-18 <%= cycle('odd', 'even') %> last">
				<div class="span-8 description"><%= link_to "#{user.name}", :action => "show", :id => user %></div>
				<% if current_user.is_administrator? %>
				<div class="span-4 description">
					<% if user.is_administrator? %>
						<%= link_to_remote image_tag('user_active_small.png', :size => '17x17', 
							:title => "Click me to disable this privilege."),
							:update => "users_management",
							:url => { :action => "disable_admin", :id => user } %>
					<% else %>
						<%= link_to_remote image_tag('user_inactive_small.png', :size => '17x17', 
							:title => "Click me to become an Administrator."),
							:update => "users_management",
							:url => { :action => "enable_admin", :id => user } %>
					<% end %>
				</div>
				<% end %>
				<div class="span-4 description">
					<% if user.is_editor? %>
						<%= link_to_remote image_tag('user_active_small.png', :size => '17x17',
							:title => "Click me to disable this privilege."),
							:update => "users_management",
							:url => { :action => "disable_editor", :id => user } %>
					<% else %>
						<%= link_to_remote image_tag('user_inactive_small.png', :size => '17x17',
							:title => "Click me to become an Editor."),
							:update => "users_management",
							:url => { :action => "enable_editor", :id => user } %>
					<% end %>
				</div>
			</div>
		<% end %>
	<% end %>
</div>